{% extends 'admin/base.html' %}

{%load comm_extras %}

{% block head_soruce %}
<script type="text/javascript">
	var urlDelete = '{%url admin-appform-delete-json 88888888 %}';

	function delAppForm(id){
		if(!confirm('你确定要删除吗？')){return;}
		var url = urlDelete.replace('88888888', id);
		$.ajax({
			url: url,
			type: 'get',
			dataType: 'json',
			success: function(result, textStatus){
				if(result){
					if(result.success){
						window.location.reload();
					}else{
						alert(result.err_msg);
					}
				}else{
					alert('删除失败');
				}
			},
			error: function(xhr, textStatus, errorThrown){
			}
		});
	}

</script>
{% endblock %}

{% block main_content %}
	<h1>合作申请管理</h1>
	<table class="Qtable">
		<tr>
			<td>标题</td>
			<td>联系方式</td>
			<td>正文</td>
			<td></td>
		</tr>
		{%for appform in appforms %}
		<tr>
			<td>{{appform.title}}</td>
			<td>{{appform.contact}}</td>
			<td>{{appform.other}}</td>
			<td><a href="javascript:void(0)" onclick="delAppForm({{appform.id}});">删除</a></td>
		</tr>
		{%endfor%}
	</table>
	{% paginator 5 %}
{% endblock %}
